<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="javascript:;">商品列表</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="post" action="{:url('Goods/index')}">
        商品分类:
        <select class="form-control" name="category" style="width:200px;">
            <option value='0'>全部</option>
			<foreach name="cate_list" item="vo">
				<option value="{$vo.id}" <eq name="category" value="$vo['id']" > selected="selected" </eq> >{$vo.name}</option>
			</foreach>
        </select> &nbsp;&nbsp;
        关键字:
        <input type="text" class="form-control" id="keyword" name="keyword" style="width: 200px;"
               value="{$keyword|default=''}" placeholder="请输入型号/编号/品牌/商品名称">
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger" href="{:url('Goods/index')}">清空</a>
        <!--<a class="btn btn-danger" id="export">导出Excel表格</a>-->
    </form>
    <form class="js-ajax-form" action="" method="post">
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="70">ID</th>
				<th width="200">商品名称</th>
                <th width="70">商品编码</th>
                <th width="100">商品型号</th>
                <th width="70">品牌名称</th>
                <th width="100">类别名称</th>
                <th width="70">操作</th>
            </tr>
            </thead>
            <foreach name="list" item="vo">
                <tr>
                    <td><b>{$vo.id}</b></td>
                    <td>{$vo.post_title}</td>
                    <td>{$vo.yg_sku}</td>
                    <td>{$vo.mode}</td>
                    <td>{$vo.ppmc}</td>
                    <td>{$vo.cate.name}</td>
                    <td>
                        <a class="btn btn-xs btn-danger" href="{:url('Goods/info',array('id'=>$vo['id']))}">查看详情</a>
                        <!--<a class="btn btn-xs btn-danger" href="{:url('Mall/shangjia',array('id'=>$vo['id']))}">上架本地商城</a>
						<a class="btn btn-xs btn-danger" href="javascript:openIframeDialog('{:url('Goods/info',array('id'=>$vo['id'],'type'=>1))}','商品报价')">报价</a>
						<a class="btn btn-xs btn-danger js-ajax-dialog-btn" data-msg="确定要删除吗" href="{:url('Goods/deletegoods',array('id'=>$vo['id']))}">删除</a>-->
                    </td>
                </tr>
            </foreach>
        </table>
		
		<div class="page"><span class="tt">共{$total}条</span>{$page}<span class="tt">每页50条</span></div>
		<style>
			.page{margin:0;}
			.page span.tt{border: 1px solid #ddd;padding: 6px 12px; line-height: 1.42857143; display:block; float:left;margin:20px 0px;}
			.page ul{float:left;}
		</style> 
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script>

    function reloadPage(win) {
        win.location.reload();
    }

    $(function () {
        $('select[name="category"]').change(function(){
            val=$(this).val();
            if(val==0){
                $('input[name="keyword"]').attr('placeholder','请输入型号/品牌/类别');
            }else if(val==1){
                $('input[name="keyword"]').attr('placeholder','请输入型号');
            }else if(val==2){
                $('input[name="keyword"]').attr('placeholder','请输入品牌');
            }else if(val==3){
                $('input[name="keyword"]').attr('placeholder','请输入类别');
            }
        })
    });


    $('#export').click(function(){
        var category=$('#category').val()?$('#category').val():-1;
        var keyword=$('#keyword').val()?$('#keyword').val():'';
      
        
        location.href = "/admin/goods/export/category/"+category+"/keyword/"+keyword;
    })
    
</script>
</body>
</html>